package ModelLayer;
import java.util.ArrayList;

public class Product
{
    private int productID;
    private String productName;
    private String desc;
    private double price; 
    private double salePrice;
    private int quantity;
    private int stock;
    private int row;
    private int shelf;
    private ArrayList<Specimen> specimens;
   
    public Product(int productID, String productName, String desc, double price, double salePrice,
    int quantity, int stock, int row, int shelf)
    {
        this.productID = productID;
        this.productName = productName;
        this.desc = desc;
        this.price = price;
        this.salePrice = salePrice;
        this.quantity = quantity;
        this.stock = stock;
        this.row = row;
        this.shelf = shelf;
      
        specimens = new ArrayList<Specimen>();
       
        
    }
    public int getProductID()
    {
        return productID;
    }
    public String getProductName()
    {
        return productName;
    }
    public void setProductName(String productName)
    {
        this.productName = productName;
    }
    public String getdesc()
    {
        return desc;
    }
    public Specimen getSpecimen(int specimenId)
    {
        Specimen specimen = null;
        int index = 0;
        boolean found = false;        
        while(index < specimens.size() && !found)
        {
            if(specimens.get(index).getSerialNr() == specimenId)
            {
                found = true;
                specimen = specimens.get(index);
            }
            else
            {
                index++;
            }
        }
        return specimen;
    }
    
      public void setSalePrice(double salePrice)
    {
        this.salePrice = salePrice;
    }
    public void setDesc(String desc)
    {
        this.desc = desc;
    }

   public double getSalePrice()
   {
        return salePrice; 
   }
   
   public void setQuantity(int quantity)
   {
        this.quantity = quantity; 
   }
   
   public int getQuantity()
   {
        return quantity; 
   }
   
   public void setStock(int stock)
   {
        this.stock = stock; 
   }
   
   public int getStock()
   {
        return stock; 
   }
   
   public void setRow(int row)
   {
        this.row = row;
   }
   
   public int getRow()
   {
       return row;
   }
   
   public void setShelf(int shelf)
   {
       this.shelf = shelf;
   }
   
   public int getShelf()
   {
        return shelf; 
   }
   public double getPrice()
   {
       return price;
   }
   public void setPrice(double price)
   {
       this.price = price;
   }
   public void createSpecimen(Specimen specimen)
    {
            specimens.add(specimen);
    } 
     
}
